import axios from '@/utils/request'

import config from '@/common/config'

const base = config.getMkBasePath()

/**
 * acti_scene
 *
 **/

// 查询所有的场景
export const listActivity = params => { return axios.get(`${base}/mk/pub/scene/list`, params); };
//查询所有的卡券
export const listCards = params => { return axios.post(`${base}/mk/mng/card/baseInfo/listAllCard`,  params); };
//插入一条活动数据
export const addActivity = params => { return axios.post(`${base}/mk/pub/activityScene/add`, params); };
//查询该门店是否在这场景
export const selectIsHasLocationByScene = params => { return axios.get(`${base}/mk//pub/scene/selectIsHasLocationByScene`, { params: params }); };
//查询所有活动
export const listActivitys = params => { return axios.get(`${base}/mk/pub/activityScene/list`, { params: params }); };
//更新活动
export const updateActivitys = params => { return axios.post(`${base}/mk/pub/activityScene/edit`, params); };
//查询该活动参与的门店
export const listlocations = params => { return axios.get(`${base}/mk/pub/activityScene/listlocations`, { params: params }); };
//查询该活动参与的奖励
export const listRewards = params => { return axios.get(`${base}/mk/pub/activityScene/listRewards`, { params: params }); };
//新增活动门店数据
export const addLocations = params => { return axios.post(`${base}/mk/pub/activityScene/addLocations`, params); };

//删除一条门店数据
export const deleteLocation = params => { return axios.post(`${base}/mk/pub/activityScene/deleteLocation`, params); };
//更新奖励数据
export const updateReward = params => { return axios.post(`${base}/mk/pub/activityScene/updateReward`, params); };
//删除一条活动数据
export const deleteActivity = params => { return axios.post(`${base}/mk/pub/activityScene/deleteActivity`, params); };
//模糊查询活动
export const listlikeActivity = params => { return axios.get(`${base}/mk/pub/activityScene/listlikeActivity`, { params: params }); };
//查询该商户是否已经参与该场景
export const listSceneByShopIdAndSceneId = params => { return axios.get(`${base}/mk/pub/activityScene/listSceneByShopIdAndSceneId`, { params: params }); };
//查询门店下商圈的所有门店
export const selectLocations = params => { return axios.get(`${base}/mall/shop/shopLocation/selectLocations`, { params: params }); };
//查询门店下的卡券
export const getLocationCards = params => { return axios.get(`${base}/mk/mng/card/baseInfo/getLocationCards`, { params: params }); };
//更新卡券的库存
export const updateCardSku = params => { return axios.post(`${base}/mk/mng/card/baseInfo/updateCardSku`, params); };
//删除一条奖励数据
export const delReward = params => { return axios.post(`${base}/mk/pub/activityScene/delReward`, params); };